﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;

namespace blackhouse.BlackApart.Business.Prices {

    internal class PriceProfileVariant {

        #region Fields

        private Dictionary<int, double> prices = new Dictionary<int, double>();

        #endregion

        #region Properties

        public bool DisableRestModifications { get; set; }
        public double DefaultPrice { get; set; }
        public DateTime FromDate { get; private set; }
        public DateTime ToDate { get; private set; }

        #endregion

        #region Constructors

        public PriceProfileVariant(DateTime fromDate, DateTime toDate) {
            this.FromDate = fromDate;
            this.ToDate = toDate;
        }

        #endregion

        #region Methods

        public void AddItem(int peopleCount, double price) {
            if (prices.ContainsKey(peopleCount))
                prices[peopleCount] = price;
            else
                prices.Add(peopleCount, price);
        }

        public double GetPrice(int peopleCount) {
            if (this.prices.ContainsKey(peopleCount))
                return this.prices[peopleCount];
            else
                return this.DefaultPrice;
        }

        #endregion

    }
}
